﻿using System;
using System.Data;
using System.Data.Common;
using Hxj.Data;
using Hxj.Data.Common;

namespace Utility.Model
{
    [Serializable]
    public class TB_SyncInfo_Data : Entity
    {
        public class _
        {
            public static readonly Field All = new Field("*", "TB_SyncInfo_Data");

            public static readonly Field userUid = new Field("userUid", "TB_SyncInfo_Data", "userUid");

            public static readonly Field userPassword = new Field("userPassword", "TB_SyncInfo_Data", "userPassword");

            public static readonly Field appCode = new Field("appCode", "TB_SyncInfo_Data", "appCode");

            public static readonly Field appPassword = new Field("appPassword", "TB_SyncInfo_Data", "appPassword");

            public static readonly Field url = new Field("url", "TB_SyncInfo_Data", "url");

            public static readonly Field operationTime_User = new Field("operationTime_User", "TB_SyncInfo_Data", "operationTime_User");

            public static readonly Field operationTime_Org = new Field("operationTime_Org", "TB_SyncInfo_Data", "operationTime_Org");

            public static readonly Field operationTime_Dic = new Field("operationTime_Dic", "TB_SyncInfo_Data", "operationTime_Dic");
        }

        private string _userUid;

        private string _userPassword;

        private string _appCode;

        private string _appPassword;

        private string _url;

        private string _operationTime_User;

        private string _operationTime_Org;

        private string _operationTime_Dic;

        public string userUid
        {
            get
            {
                return _userUid;
            }
            set
            {
                OnPropertyValueChange(_.userUid, _userUid, value);
                _userUid = value;
            }
        }

        public string userPassword
        {
            get
            {
                return _userPassword;
            }
            set
            {
                OnPropertyValueChange(_.userPassword, _userPassword, value);
                _userPassword = value;
            }
        }

        public string appCode
        {
            get
            {
                return _appCode;
            }
            set
            {
                OnPropertyValueChange(_.appCode, _appCode, value);
                _appCode = value;
            }
        }

        public string appPassword
        {
            get
            {
                return _appPassword;
            }
            set
            {
                OnPropertyValueChange(_.appPassword, _appPassword, value);
                _appPassword = value;
            }
        }

        public string url
        {
            get
            {
                return _url;
            }
            set
            {
                OnPropertyValueChange(_.url, _url, value);
                _url = value;
            }
        }

        public string operationTime_User
        {
            get
            {
                return _operationTime_User;
            }
            set
            {
                OnPropertyValueChange(_.operationTime_User, _operationTime_User, value);
                _operationTime_User = value;
            }
        }


        public string operationTime_Org
        {
            get
            {
                return _operationTime_Org;
            }
            set
            {
                OnPropertyValueChange(_.operationTime_Org, _operationTime_Org, value);
                _operationTime_Org = value;
            }
        }

        public string operationTime_Dic
        {
            get
            {
                return _operationTime_Dic;
            }
            set
            {
                OnPropertyValueChange(_.operationTime_Dic, _operationTime_Dic, value);
                _operationTime_Dic = value;
            }
        }

        public TB_SyncInfo_Data()
            : base("TB_SyncInfo_Data")
        {
            _userUid = Guid.NewGuid().ToString();
        }

        public override Field[] GetPrimaryKeyFields()
        {
            return new Field[1]
            {
            _.userUid
            };
        }

        public override Field[] GetFields()
        {
            return new Field[8]
            {
                _.userUid,
                _.userPassword,
                _.appCode,
                _.appPassword,
                _.url,
                _.operationTime_User,
                _.operationTime_Org,
                _.operationTime_Dic
            };
        }

        public override object[] GetValues()
        {
            return new object[8]
            {
                _userUid,
                _userPassword,
                _appCode,
                _appPassword,
                _url,
                _operationTime_User,
                _operationTime_Org,
                _operationTime_Dic
            };
        }

        public override void SetPropertyValues(IDataReader reader)
        {
            _userUid = DataUtils.ConvertValue<string>(reader["userUid"]);
            _userPassword = DataUtils.ConvertValue<string>(reader["userPassword"]);
            _appCode = DataUtils.ConvertValue<string>(reader["appCode"]);
            _appPassword = DataUtils.ConvertValue<string>(reader["appPassword"]);
            _url = DataUtils.ConvertValue<string>(reader["url"]);
            _operationTime_User = DataUtils.ConvertValue<string>(reader["operationTime_User"]);
            _operationTime_Org = DataUtils.ConvertValue<string>(reader["operationTime_Org"]);
            _operationTime_Dic = DataUtils.ConvertValue<string>(reader["operationTime_Dic"]);
        }

        public override void SetPropertyValues(DataRow row)
        {
            _userUid = DataUtils.ConvertValue<string>(row["userUid"]);
            _userPassword = DataUtils.ConvertValue<string>(row["userPassword"]);
            _appCode = DataUtils.ConvertValue<string>(row["appCode"]);
            _appPassword = DataUtils.ConvertValue<string>(row["appPassword"]);
            _url = DataUtils.ConvertValue<string>(row["url"]);
            _operationTime_User = DataUtils.ConvertValue<string>(row["operationTime_User"]);
            _operationTime_Org = DataUtils.ConvertValue<string>(row["operationTime_Org"]);
            _operationTime_Dic = DataUtils.ConvertValue<string>(row["operationTime_Dic"]);
        }

    }
}

